package com.ly.bean;

import java.io.Serializable;

import lombok.*;
import org.apache.solr.client.solrj.beans.Field;

/**
@author 李岩
@date 2021/12/14-13:52
@describe
*/

public class EasybuyProduct implements Serializable {
    /**
    * 主键
    */
    @Field("id")
    private Integer id;

    /**
    * 名称
    */
    @Field("prod_name")
    private String name;

    /**
    * 描述
    */
    @Field("prod_desc")
    private String description;

    /**
    * 价格
    */
    @Field("prod_price")
    private Double price;

    /**
    * 库存
    */
    @Field("prod_stock")
    private Integer stock;

    /**
    * 分类1
    */
    @Field("prod_cate")
    private Integer categorylevel1id;

    /**
    * 分类2
    */
    private Integer categorylevel2id;

    /**
    * 分类3
    */
    private Integer categorylevel3id;

    /**
    * 文件名称
    */
    private String filename;

    /**
    * 是否删除(1：删除 0：未删除)
    */
    @Field("prod_isdelete")
    private Integer isdelete;

    /**
    * 商家ID
    */
    @Field("prod_sellerId")
    private String sellerId;

    /**
     * 商家名称
     */
    private String sellerName;

    //查询条件
    private String keyword;

    //搜索条件的最大值
    private Integer maxPrice;

    //搜索条件的最小值
    private Integer minPrice;


    @Override
    public String toString() {
        return "EasybuyProduct{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", price=" + price +
                ", stock=" + stock +
                ", categorylevel1id=" + categorylevel1id +
                ", categorylevel2id=" + categorylevel2id +
                ", categorylevel3id=" + categorylevel3id +
                ", filename='" + filename + '\'' +
                ", isdelete=" + isdelete +
                ", sellerId='" + sellerId + '\'' +
                ", sellerName='" + sellerName + '\'' +
                ", keyword='" + keyword + '\'' +
                ", maxPrice=" + maxPrice +
                ", minPrice=" + minPrice +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Integer getStock() {
        return stock;
    }

    public void setStock(Integer stock) {
        this.stock = stock;
    }

    public Integer getCategorylevel1id() {
        return categorylevel1id;
    }

    public void setCategorylevel1id(Integer categorylevel1id) {
        this.categorylevel1id = categorylevel1id;
    }

    public Integer getCategorylevel2id() {
        return categorylevel2id;
    }

    public void setCategorylevel2id(Integer categorylevel2id) {
        this.categorylevel2id = categorylevel2id;
    }

    public Integer getCategorylevel3id() {
        return categorylevel3id;
    }

    public void setCategorylevel3id(Integer categorylevel3id) {
        this.categorylevel3id = categorylevel3id;
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public Integer getIsdelete() {
        return isdelete;
    }

    public void setIsdelete(Integer isdelete) {
        this.isdelete = isdelete;
    }

    public String getSellerId() {
        return sellerId;
    }

    public void setSellerId(String sellerId) {
        this.sellerId = sellerId;
    }

    public String getSellerName() {
        return sellerName;
    }

    public void setSellerName(String sellerName) {
        this.sellerName = sellerName;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public Integer getMaxPrice() {
        if (price==null)
            return null;
        if (price==0)
            return 399;
        if (price==1)
            return 899;
        if (price==2)
            return 1399;
        if (price==3)
            return 999999999;
        return maxPrice;
    }

    public void setMaxPrice(Integer maxPrice) {
        this.maxPrice = maxPrice;
    }

    public Integer getMinPrice() {
        if (price==null)
            return null;
        if (price==0)
            return 0;
        if (price==1)
            return 400;
        if (price==2)
            return 900;
        if (price==3)
            return 1400;
        return minPrice;
    }

    public void setMinPrice(Integer minPrice) {
        this.minPrice = minPrice;
    }

    private static final long serialVersionUID = 1L;
}